﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;

public class ChangeUIMenu : MonoBehaviour 
{
	public List<GameObject> Panels;
	public Slider PanelSlider;
	public float y;
	public int x = 0;
	
	public SettlementService main;
	// Use this for initialization
	
	public void ChangeUIList()
	{
		
		y = PanelSlider.value;
		x = Mathf.FloorToInt(y);
	
		for (int a =0; a < Panels.Count; a++)
		{
			Panels[a].SetActive(false);
			Panels[x].SetActive(true);
			
		}
		main.PanelTitle.text = Panels[x].name;
	}
	

    public void ChangeUI(GameObject obj)
    {
        this.gameObject.SetActive(false);
        if (obj != null)
            obj.SetActive(true);

        
        
    }
    
}
